<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    @if (isset($isHome))
        <title>{{ $title }}</title>
    @elseif (isset($title))
        <title>{{ $title }} | {{ $setting->blog_name }}</title>
    @else
        <title>{{ $setting->blog_name }}</title>
    @endif
    @isset($keywords)
        <meta name="keywords" content="{{ $keywords }}"/>
    @endisset
    @isset($description)
        <meta name="description" content="{{ $description }}"/>
    @endisset
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no"/>
    <meta name="format-detection" content="telephone=no,email=no"/>
    <link rel="stylesheet" href="/static/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="/static/ckeditor/plugins/codesnippet/lib/highlight/styles/stackoverflow-dark.css" media="all"/>
    <link rel="stylesheet" href="/static/css/main.css" media="all"/>
    @yield('add_script', '')
    <script src="/static/layui/layui.js"></script>
    <script src="/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.pack.js"></script>
    <script src="/static/ckeditor/plugins/codesnippet/lib/highlight/highlight.line-numbers.js"></script>
    <script src="/static/js/clipboard.min.js"></script>
    <script src="/static/js/main.js?v3"></script>
</head>
<body>
<header class="@yield('header_class')">
    <div class="layui-container">
        <div id="title-container" class="title-container">
            <div id="site-title" class="site-title">
                <a href="/">{{ $setting->blog_name }}</a>
            </div>
            <p class="tagline">{{ $setting->blog_tagline }}</p>
        </div>
        <div class="toggle-navigation"></div>
        <div class="menu-container layui-show-md-block">
            <ul>
                <li @isset($isHome)class="current"@endisset>
                    <a href="/">首页</a>
                </li>
                @foreach ($categories as $category)
                    @if ($category['show_menu'])
                        <li @if(isset($categoryId) && $categoryId == $category['id'])class="current"@endif>
                            <a href="/category/{{ $category['alias'] }}">{{ $category['name'] }}</a>
                        </li>
                    @endif
                @endforeach
            </ul>
        </div>
    </div>
</header>
<div class="layui-container site-body">
    <div class="layui-row layui-col-space30">
        @yield('content')
    </div>
</div>
<footer class="site-footer">
    <div class="layui-container">
        <div class="footer-content">
            {!! $setting->footer_content !!}
        </div>
    </div>
</footer>
</body>
</html>
